<template>
  <el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px" size="large">
    <el-form-item label="项目" prop="projectId">
      <el-input v-model="formData.projectId" placeholder="请选择项目" />
    </el-form-item>
  </el-form>
</template>
<script setup>
import { ref, reactive } from 'vue'

const formRef = ref()
const formData = reactive({
  projectId: '',
})

const formRules = {
  projectId: [{ required: true, message: '请选择项目', trigger: 'blur' }],
}

// 校验
const validate = () => {
  return formRef.value.validate()
}

defineExpose({
  formData,
  validate
})
</script>